//package com.zmn.plat.dubbo.impl.product;
//
//import com.alibaba.fastjson.JSON;
//import com.zmn.common.constant.GlobalConsts;
//import com.zmn.common.dto.VtDTO;
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.common.utils.number.NumberUtil;
//import com.zmn.manager.common.database.annotation.ReadOnlyConnection;
//import com.zmn.plat.business.interfaces.channel.ChannelCategBService;
//import com.zmn.plat.business.interfaces.channel.ChannelServiceCategoryBService;
//import com.zmn.plat.business.interfaces.product.*;
//import com.zmn.plat.common.constant.ProductConsts;
//import com.zmn.plat.common.dictionary.PlatErrorCodeDict;
//import com.zmn.plat.common.dto.product.*;
//import com.zmn.plat.common.dto.product.base.ProductBaseDRO;
//import com.zmn.plat.common.dto.product.emissions.ProductEmissionsDRO;
//import com.zmn.plat.common.dto.product.picture.ProductGuaranteeDRO;
//import com.zmn.plat.common.dto.product.picture.ServProductPictureDRO;
//import com.zmn.plat.common.dto.product.price.ProductPriceDRO;
//import com.zmn.plat.common.exception.PlatException;
//import com.zmn.plat.dubbo.interfaces.product.ProductListRemoteService;
//import com.zmn.plat.dubbo.utils.DubboConsts;
//import com.zmn.plat.model.entity.category.ServCategAndCategTwoQuery;
//import com.zmn.plat.model.entity.product.ProductQuery;
//import com.zmn.plat.model.entity.product.ServProduct;
//import com.zmn.plat.model.vo.product.ProductAllMsgVO;
//import com.zmn.plat.model.vo.product.emissions.ProductEmissionsVO;
//import com.zmn.plat.services.interfaces.product.ServProductService;
//import com.zmn.plat.utils.bean.BeanCopyUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.Service;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.BeanUtils;
//import org.springframework.cache.annotation.Cacheable;
//import org.springframework.util.CollectionUtils;
//
//import javax.annotation.Resource;
//import javax.validation.Valid;
//import javax.validation.constraints.NotNull;
//import java.util.*;
//import java.util.stream.Collectors;
//
///**
// * @author tanghongjun
// * @version v1.0
// * @类说明：基础产品查询dubbo实现类
// * @since 2019年12月18日15:22:02
// */
//@Slf4j
//@Service(version = DubboConsts.INTERFACE_VERSION, validation = "true")
//public class ProductListRemoteServiceImpl implements ProductListRemoteService {
//    private Logger logger = LoggerFactory.getLogger(ProductListRemoteServiceImpl.class);
//
//    private static final String TAG = "产品 dubbo 接口";
//
//    @Resource
//    ProductCache productCache;
//    @Resource
//    ProductBService productBService;
//    @Resource
//    ServProductService servProductService;
//
//    @Resource
//    ServProductBService servProductBService;
//
//    @Resource
//    ProductPriceBService productPriceBService;
//
//    @Resource
//    ChannelServiceCategoryBService channelServiceCategoryBService;
//
//    @Resource
//    ChannelCategBService channelCategBService;
//    @Resource
//    ProductDetailsBService productDetailsBService;
//
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Integer> getTotalEmissionsById(@NotNull(message = "产品ID不能为空") @Valid Integer productId) {
//
//        log.info("getTotalEmissionsById：productId={}", productId);
//
//        ServProduct servProduct = servProductService.findByKey(productId);
//        if (Objects.isNull(servProduct) || NumberUtil.isNullOrZero(servProduct.getTotalEmissions())) {
//            log.error("产品不存在，productId:{},errorCode:{}", productId,
//                    PlatErrorCodeDict.ERROR_CODE_PRODUCT_NO_TOTALEMISSION);
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PRODUCT_NO_TOTALEMISSION);
//        }
//        return ResponseDTO.success(servProduct.getTotalEmissions());
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Integer> getTotalEmissionsByShowProductId(@NotNull(message = "前台产品ID不能为空") @Valid Integer showProductId) {
//        log.info("getTotalEmissionsByShowProductId：showProductId={}", showProductId);
//
//        if (NumberUtil.isNullOrZero(showProductId)) {
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//        }
//
//        Integer totalEmissions = servProductService.findTotalEmissionsByShowProductId(showProductId);
//        if (NumberUtil.isNullOrZero(totalEmissions)) {
//            log.error("前台产品总排放量不存在，showProductId:{},errorCode:{}", showProductId, PlatErrorCodeDict.ERROR_CODE_PRODUCT_NO_TOTALEMISSION);
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PRODUCT_NO_TOTALEMISSION);
//        }
//
//        return ResponseDTO.success(totalEmissions);
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Boolean> checkTraiffByChannelAndCityAndProductAndType(Integer channelId, Integer cityId, Integer productId, Integer type) {
//        log.info("checkTraiffByChannelAndCityAndProductAndType参数为：channelId={},cityId={},productId={},type={}", channelId, cityId, productId, type);
//        try {
//            Boolean result = productBService.checkTraiffByChannelAndCityAndProductAndType(channelId, cityId, productId, type);
//            return ResponseDTO.success(result);
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("checkTraiffByChannelAndCityAndProductAndType error.channelId={},cityId={},productId={},type={}", channelId, cityId, productId, type, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductEmissionsDRO>> listTotalEmissionsByShowProductIdList(List<Integer> showProductIds) {
//        log.info("listTotalEmissionsByShowProductIdList参数为：showProductIds={}", showProductIds);
//
//        if (CollectionUtils.isEmpty(showProductIds)) {
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//        }
//
//        try {
//            List<ProductEmissionsVO> result = servProductService.listTotalEmissionsByShowProductIdList(showProductIds.stream().distinct().collect(Collectors.toList()));
//            List<ProductEmissionsDRO> list = BeanCopyUtils.copyProperties(result, ProductEmissionsVO.class, ProductEmissionsDRO.class, ProductEmissionsDRO::new);
//            return ResponseDTO.success(list);
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("listTotalEmissionsByShowProductIdList error.showProductIds={}", showProductIds, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ShowProductDefaultSimpleDRO>> listDefaultShowProductsByShowProductIds(ShowProductDefaultSimpleDIO dio) {
//        log.info("getDefaultShowProductByShowProductId：dio={}", JSON.toJSONString(dio));
//        try {
//            List<ShowProductDefaultSimpleDRO> result = productBService.listDefaultShowProductsByShowProductIds(dio);
//            return ResponseDTO.success(result);
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("listDefaultShowProductsByShowProductIds error.：showProductId={}", JSON.toJSONString(dio), e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductAllMsgInfoDRO>> listByDIO(ProductDIO productDIO) {
//        log.info("listByDIO 参数为：productDIO={}", productDIO);
//        try {
//
//            List<ProductAllMsgInfoDRO> dros = productBService.listByDIO(productDIO);
//            return ResponseDTO.success(dros);
//
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByDIO error.productDIO={}", productDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductAllMsgInfoDRO>> listSimpleByDIO(@NotNull(message = "入参不能为空") @Valid ProductSimpleDIO dio) {
//
//        log.info("ProductListRemoteServiceImpl.listSimpleByDIO入参:{}", dio);
//        if (dio == null || CollectionUtils.isEmpty(dio.getProductIdList())) {
//            log.error("入参不合法：" + PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//            throw new PlatException(PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//        }
//        try {
//            // 查询产品基础信息
//
//            ProductQuery productQuery = new ProductQuery();
//            BeanUtils.copyProperties(dio, productQuery);
//            productQuery.setBizType(String.valueOf(dio.getBizType()));
//
//            if (NumberUtil.isNullOrZero(dio.getDefaultType()) && Objects.equals(dio.getShowType(), ProductConsts.EC_PRODUCT_TYPE)) {
//                productQuery.setDefaultType(GlobalConsts.NO);
//            }
//            Integer channelId = dio.getChannelId();
//            if (NumberUtil.isPositiveInteger(channelId)) {
//                channelId = channelServiceCategoryBService.getAvailableCategoryChannelId(channelId);
//                logger.info("可用渠道channelId:{}", channelId);
//                productQuery.setChannelId(channelId);
//            }
//
//            // 如果渠道和服务分类不为空，需要查询渠道开通的二级分类
//            if (Objects.nonNull(channelId) && Objects.nonNull(dio.getShowType()) && Objects.nonNull(dio.getCityId())) {
//                int showType = Objects.equals(ProductConsts.ERP_PRODUCT_TYPE, dio.getShowType()) ? ProductConsts.ERP_PRODUCT_TYPE : ProductConsts.EC_PRODUCT_TYPE;
//                List<ServCategAndCategTwoQuery> servCategAndCategTwoQueryList =
//                        channelCategBService.listServCategAndCategTwoQueryByChannelIdAndShowType(channelId, dio.getCityId(), showType);
//                if (CollectionUtils.isEmpty(servCategAndCategTwoQueryList)) {
//                    return ResponseDTO.success(Collections.emptyList(), "渠道未开通分类");
//                }
//                productQuery.setServCategAndCategTwoQueryList(servCategAndCategTwoQueryList);
//            }
//
//            // 查询满足条件的产品
//            List<ProductAllMsgVO> productAllMsgVOList = productCache.listByProductQuery(productQuery);
//            // 如果查询默认产品，没有默认产品则查询普通产品
//            if (CollectionUtils.isEmpty(productAllMsgVOList) && Objects.equals(GlobalConsts.YES, dio.getDefaultType())) {
//                productQuery.setDefaultType(GlobalConsts.NO);
//                productAllMsgVOList = productCache.listByProductQuery(productQuery);
//            }
//
//            logger.info("产品集合productAllMsgVOList:{}", productAllMsgVOList);
//            if (CollectionUtils.isEmpty(productAllMsgVOList)) {
//                return ResponseDTO.success(Collections.emptyList(), "没有满足条件的产品");
//            }
//
//            List<ProductBaseDRO> productBaseDROList = productAllMsgVOList.stream().map(productAllMsgVO -> {
//                ProductBaseDRO productBase = new ProductBaseDRO();
//                BeanUtils.copyProperties(productAllMsgVO, productBase);
//                return productBase;
//            }).collect(Collectors.toList());
//
//            List<Integer> productIdList = new ArrayList<>(productBaseDROList.size());
//            Map<Integer, ProductBaseDRO> productBaseDROMap = new HashMap<>(productBaseDROList.size());
//            for (ProductBaseDRO productBaseDRO : productBaseDROList) {
//                productIdList.add(productBaseDRO.getProductId());
//                productBaseDROMap.put(productBaseDRO.getProductId(), productBaseDRO);
//            }
//
//            // 查询产品图片信息
//            Map<Integer, ServProductPictureDRO> productPictureDROMap = new HashMap<>(productIdList.size());
//            List<ServProductPictureDRO> servProductPictureDROList = productBService.listProductPictureByIdList(productIdList);
//            for (ServProductPictureDRO servProductPictureDRO : servProductPictureDROList) {
//                productPictureDROMap.put(servProductPictureDRO.getProductId(), servProductPictureDRO);
//            }
//
//            // 查询产品保障信息
//            Map<Integer, ProductGuaranteeDRO> productGuaranteeDROMap = new HashMap<>(productIdList.size());
//            List<ProductGuaranteeDRO> servProductGuaranteeDROList = productBService.listProductGuaranteeByIdList(productIdList);
//            for (ProductGuaranteeDRO productGuaranteeDRO : servProductGuaranteeDROList) {
//                productGuaranteeDROMap.put(productGuaranteeDRO.getProductId(), productGuaranteeDRO);
//            }
//
//            // 返回组装产品信息
//            List<ProductAllMsgInfoDRO> productAllMsgInfoDROList = new ArrayList<>(productIdList.size());
//            ProductAllMsgInfoDRO productAllMsgInfoDRO;
//            int productId;
//            for (int i = 0; i < productIdList.size(); i++) {
//                productId = productIdList.get(i);
//                productAllMsgInfoDRO = new ProductAllMsgInfoDRO();
//                if (Objects.nonNull(productBaseDROMap.get(productId))) {
//                    productAllMsgInfoDRO.setProductBaseDRO(productBaseDROMap.get(productId));
//                }
//                if (Objects.nonNull(productPictureDROMap.get(productId))) {
//                    productAllMsgInfoDRO.setServProductPictureDRO(productPictureDROMap.get(productId));
//                }
//                if (Objects.nonNull(productGuaranteeDROMap.get(productId))) {
//                    productAllMsgInfoDRO.setProductGuaranteeDRO(productGuaranteeDROMap.get(productId));
//                }
//                productAllMsgInfoDROList.add(productAllMsgInfoDRO);
//            }
//            return ResponseDTO.success(productAllMsgInfoDROList);
//        } catch (PlatException e) {
//            log.error("ProductListRemoteServiceImpl.listSimpleByDIO查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductAllMsgInfoExtDRO>> listExtInfoByDIO(@NotNull(message = "入参不能为空") @Valid ProductDIO productDIO) {
//        log.info("listExtInfoByDIO 参数为：productDIO={}", productDIO);
//        try {
//
//            List<ProductAllMsgInfoExtDRO> dros = productBService.listExtInfoByDIO(productDIO);
//            return ResponseDTO.success(dros);
//
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByDIO error.productDIO={}", productDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductPriceDRO>> listProductPriceByIdListAndChannelAndCityAndShowTypeAndTypeAndBrand(List<Integer> productIdList, Integer channelId, Integer cityId, Integer showType,
//                                                                                                                  Integer type, Boolean isTariffChannel, Integer brandId) {
//        log.info("listProductPriceByIdListAndChannelAndCityAndShowTypeAndTypeAndBrand 参数为：productIdList={}，channelId={},cityId={},showType={},type={},isTariffChannel={},brandId={}", productIdList,
//                channelId, cityId, showType, type, isTariffChannel, brandId);
//        try {
//            List<ProductPriceDRO> productPriceDROList =
//                    productBService.listProductPriceByIdListAndChannelAndCityAndShowTypeAndTypeAndBrand(productIdList, channelId, cityId, showType, type, isTariffChannel, brandId);
//            return ResponseDTO.success(productPriceDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductPriceByIdListAndChannelAndCityAndShowTypeAndTypeAndBrand error.：productIdList={}，channelId={},cityId={},showType={},type={},isTariffChannel={},brandId={}",
//                    productIdList, channelId, cityId, showType, type, isTariffChannel, brandId, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductPriceDRO>> listProductPriceByDIO(ProductPriceDIO productPriceDIO) {
//        log.info("listProductPriceByDIO 参数为：productPriceDIO={}", JSON.toJSONString(productPriceDIO));
//        try {
//            List<ProductPriceDRO> productPriceDROList = productPriceBService.listProductPriceByDIO(productPriceDIO);
//            return ResponseDTO.success(productPriceDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductPriceByDIO error.：productPriceDIO={}", JSON.toJSONString(productPriceDIO), e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductGuaranteeDRO>> listProductGuaranteeByIdList(List<Integer> productIdList) {
//        log.info("listProductGuaranteeByIdList 参数为：{}", productIdList);
//        try {
//            List<ProductGuaranteeDRO> productGuaranteeDROList = productBService.listProductGuaranteeByIdList(productIdList);
//            return ResponseDTO.success(productGuaranteeDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductGuaranteeByIdList error.：productIdList={}", productIdList, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ServProductPictureDRO>> listProductPictureByIdList(List<Integer> productIdList) {
//        log.info("listProductPictureByIdList 参数为：{}", productIdList);
//        try {
//            List<ServProductPictureDRO> servProductPictureDROList = productBService.listProductPictureByIdList(productIdList);
//            return ResponseDTO.success(servProductPictureDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductPictureByIdList error.：productIdList={}", productIdList, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<VtDTO>> listVtByNameList(List<String> nameList, Integer showType) {
//        log.info("listVtByNameList 参数为：nameList={},showType={}", nameList, showType);
//        if (CollectionUtils.isEmpty(nameList) || nameList.size() > DubboConsts.MAX_PARAM_LENGTH) {
//            log.error("参数不合法,errorCode:{}", PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PANAM_NULL);
//        }
//
//        List<ServProduct> servProductList = servProductService.listByNameList(nameList, showType);
//        if (CollectionUtils.isEmpty(servProductList)) {
//            log.error("产品为空,errorCode:{}", PlatErrorCodeDict.ERROR_CODE_PRODUCT_PRODUCT_NO_DATA);
//            return ResponseDTO.fromErrorCodeTable(PlatErrorCodeDict.ERROR_CODE_PRODUCT_PRODUCT_NO_DATA);
//        }
//
//        List<VtDTO> dtos = servProductList.stream().map(servProduct -> new VtDTO(servProduct.getProductId(), servProduct.getName())).collect(Collectors.toList());
//
//        return ResponseDTO.success(dtos);
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductBaseDRO>> listBaseDROByDIO(ProductDIO productDIO) {
//        log.info("listBaseDROByDIO 参数为：{}", productDIO);
//        try {
//           List<ProductBaseDRO> productBaseDROList = productDetailsBService.listBaseDROByDIO(productDIO);
//            // List<ProductBaseDRO> productBaseDROList = productBService.listBaseDROByDIO(productDIO);
//            return ResponseDTO.success(productBaseDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listBaseDROByDIO error.：productIdList={}", productDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    public ResponseDTO<List<ProductBaseDRO>> listEcProduct(Integer bizType) {
//        try {
//            List<ProductBaseDRO> productBaseDROList = productDetailsBService.listEcProduct(bizType);
//            return ResponseDTO.success(productBaseDROList);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listEcProduct error.：bizType={}", bizType, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductBaseDRO>> listByShowTypeAndServCategAndCategAndStatus(Integer showType, Integer servCategId, Integer categTwoId, Integer status) {
//        log.info("listByShowTypeAndServCategAndCategAndStatus参数为.：showType={},servCategId={},categTwoId={},status={}", showType, servCategId, categTwoId, servCategId);
//        try {
//            List<ProductBaseDRO> productBaseDROS = productBService.listByShowTypeAndServCategAndCategAndStatus(showType, servCategId, categTwoId, status);
//            return ResponseDTO.success(productBaseDROS);
//        } catch (PlatException ex) {
//            return ResponseDTO.fromErrorCodeTable(ex.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByShowTypeAndServCategAndCategAndStatus error.：showType={},servCategId={},categTwoId={},status={}", showType, servCategId, categTwoId, servCategId, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductBaseDRO>> listProductByProductIdAndStatus(Integer productId, Integer status) {
//        log.info("listProductByProductIdAndStatus参数为：productID={},status={}", productId, status);
//        try {
//            List<ProductBaseDRO> list = servProductBService.listProductByProductIdAndStatus(productId, status);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.info("listProductByProductIdAndStatus error：productID={},status={}", productId, status, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//
//    }
//
//    @Override
//    @ReadOnlyConnection
//    @Cacheable(key = "'dubbo:list:base:products:showproduct:' + #p0 + ':status:' + #p1 + ':channel:' + #p2 + ':type:' + #p3", cacheNames = "redis5m")
//    public ResponseDTO<List<ProductBaseDRO>> listProductByShowProductIdAndStatusAndChannelIdAndProductType(Integer showProductId, Integer status, Integer channelId, Integer productType) {
//        log.info("listProductByShowProductIdAndStatusAndChannelIdAndProductType参数为：showProductId={},status={},channelId={},productType={}", showProductId, status, channelId, productType);
//        try {
//            List<ProductBaseDRO> list = servProductBService.listProductByShowProductIdAndStatusAndChannelIdAndProductType(showProductId, status, channelId, productType);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.info("listProductByProductIdAndStatus error：：showProductId={},status={},channelId={},productType={}", showProductId, status, channelId, productType, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductBaseDRO>> listProductPageByDio(ProductDIO query) {
//        logger.info("listProductPageByDio 输入参数为：query={}", query);
//
//        try {
//            List<ProductBaseDRO> list = productBService.listProductPageByDio(query);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            logger.error("listProductPageByDio error,query={}", query, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ProductBaseDRO>> listByChannelIdAndProductDIO(Integer channelId, ProductDIO servProductDIO) {
//        logger.info("listByChannelIdAndProductDIO 输入参数为：channelId={},servProductDIO={}", channelId, servProductDIO);
//
//        try {
//            List<ProductBaseDRO> list = productBService.listByChannelIdAndProductDIO(channelId, servProductDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            logger.error("listByChannelIdAndProductDIO error,channelId={},servProductDIO={}", channelId, servProductDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Integer> countByDio(ProductDIO query) {
//        logger.info("countByDio 输入参数为：query={}", query);
//
//        try {
//            Integer count = productBService.countByDio(query);
//            return ResponseDTO.success(count);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            logger.error("countByDio error,query={}", query, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Integer> countByChannelIdAndProductDIO(Integer channelId, ProductDIO servProductDIO) {
//        logger.info("countByChannelIdAndProductDIO 输入参数为：channelId={},servProductDIO={}", channelId, servProductDIO);
//
//        try {
//            Integer count = productBService.countByChannelIdAndProductDIO(channelId, servProductDIO);
//            return ResponseDTO.success(count);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            logger.error("countByChannelIdAndProductDIO error,channelId={},servProductDio={}", channelId, servProductDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    /**
//     * 描述: 定渠道Id和城市Id与给定商品Id进行筛选
//     *
//     * @param productDIO 前台产品id
//     * @return List《Integer》
//     * @auther liuyong
//     * @since 20201/4/22 16:20
//     */
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<Integer>> getShowProductIds(ShowProductDefaultSimpleDIO productDIO) {
//        logger.info("getShowProductIds 输入参数为：query={}", productDIO);
//        try {
//            List<Integer> list = productBService.getShowProductIds(productDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            logger.error("getShowProductIds error,query={}", productDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//}
